<?php

if(!isset($_GET['imgid'])){
	exit; 
}
 
$imgid = $_GET['imgid'];
global $wpdb;

$image = $wpdb->get_row("SELECT  * FROM ap_painting_img WHERE id = {$imgid}");

?>

<img width="800" height="auto" src="<?php echo $image->url ?>" /> 

